package com.audaque.springboot.foshanupload.web.esdatademo.model.pojo;

import lombok.Data;
import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.annotations.InnerField;
import org.springframework.data.elasticsearch.annotations.MultiField;

import java.util.List;

/**
 * PUT my-index-join_family
 * {
 * 	"mappings":{
 * 		"properties":{
 * 			"my_id":{
 * 				"type":"keyword"
 *                        },
 * 			"name":{
 * 			  "type":"keyword"
 *            },
 * 			"level":{
 * 			  "type":"keyword"
 *            },
 * 			"join_filed":{  //1关联的字段名，可以随意取
 * 				"type":"join", //类型需要定义为join
 * 				"relations":{ //定义层级关系，grand_parent ->parent -> child
 * 					"grand_parent":"parent",
 * 					"parent":"child"
 *                }
 *            }* 		}
 * 	}
 * }
 */
@Data
@ToString
public class JoinFamily {
    private String my_id;

    private String name;
    private String level;
    //关联字段
    private JoinField join_filed;
    private List<JoinFamily> child;
}
